﻿using Clothes.IDAL;
using Clothes.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Clothes.DAL
{
    /// <summary>
    /// 用户信息数据服务类
    /// </summary>
    public class UserService : IUserService
    {
        public CLUser EditAvatar(CLUser profile)
        {
            throw new NotImplementedException();
        }

        public CLUser EditWithoutAvatar(CLUser profile)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// 通过用户编号查找
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public CLUser FindByUserId(int userId)
        {
            ClothesContext dbContext = new ClothesContext();
            return dbContext.CLUser.SingleOrDefault(m => m.Id == userId);
        } 
    }
}

